<?php

namespace Biz\Requests\Site;

use Illuminate\Validation\Rule;
use Biz\Dictionaries\GenderDict;
use Lumen\Validation\Validators\RequestValidator;

/**
 * SiteVisaRequest.
 *
 * @license [http://www.85do.com] [杭州永奥网络科技有限公司]
 * @copyright Copyright (c) 2018-2026 Hangzhou Yongao Technology Co., Ltd. All rights reserved.
 */
class SiteVisaRequest extends RequestValidator
{
    /**
     * Get custom rules for validator errors.
     *
     * @return array
     */
    public function rules(): array
    {
        return [
            'relationship'                             => 'required|string|max:128',
            'full_name'                                => 'required|string|max:128',
            'gender'                                   => [
                'required',
                'string',
                'max:8',
                Rule::in(GenderDict::keys()),
            ],
            'birthday'                                     => 'required|date',
            'nationality'                                  => 'required|string|max:128',
            'passport_number'                              => 'required|string|max:128',
            'address'                                      => 'required|string|max:255',
            'designation_title'                            => 'required|string|max:128',
            'issuing_country'                              => 'required|string|max:128',
            'duration_arrival'                             => 'required|date',
            'duration_departure'                           => 'required|date|after:duration_arrival',
            'passport_front_url'                           => 'required|string|max:255',
            'passport_back_url'                            => 'required|string|max:255',
        ];
    }
}
